﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_YH_SHUIBIAOXXB实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_YH_SHUIBIAOXXB
    {
        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_wtype;

        private decimal? m_dec_i_xuhao;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuorq;

        private DateTime? m_DT_d_tianjiarq;

        private string m_str_s_beizhu;

        private string m_str_s_biaobiaoj;

        private string m_str_s_biaofenl;

        private string m_str_s_biaohao;

        private string m_str_s_caozuor;

        private string m_str_s_cehao;

        private string m_str_s_jieshuny;

        private string m_str_s_kaishiny;

        private string m_str_s_qushuik;

        private string m_str_s_shuibiaobh;

        private string m_str_s_shuilianglb;

        private string m_str_s_tianjiar;

        private string m_str_s_yuanshuibh;

        private string m_str_s_zhiliang;

        private string m_str_s_zongbiaoh;

        /// <summary>
        ///     自增量
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     深井或取水口编号
        /// </summary>
        public string S_QUSHUIK
        {
            get { return m_str_s_qushuik; }
            set { m_str_s_qushuik = value; }
        }

        /// <summary>
        ///     水表编号
        /// </summary>
        public string S_SHUIBIAOBH
        {
            get { return m_str_s_shuibiaobh; }
            set { m_str_s_shuibiaobh = value; }
        }

        /// <summary>
        ///     册号
        /// </summary>
        public string S_CEHAO
        {
            get { return m_str_s_cehao; }
            set { m_str_s_cehao = value; }
        }

        /// <summary>
        ///     表号
        /// </summary>
        public string S_BIAOHAO
        {
            get { return m_str_s_biaohao; }
            set { m_str_s_biaohao = value; }
        }

        /// <summary>
        ///     表分类
        /// </summary>
        public string S_BIAOFENL
        {
            get { return m_str_s_biaofenl; }
            set { m_str_s_biaofenl = value; }
        }

        /// <summary>
        ///     表标记
        /// </summary>
        public string S_BIAOBIAOJ
        {
            get { return m_str_s_biaobiaoj; }
            set { m_str_s_biaobiaoj = value; }
        }

        /// <summary>
        ///     水量类别
        /// </summary>
        public string S_SHUILIANGLB
        {
            get { return m_str_s_shuilianglb; }
            set { m_str_s_shuilianglb = value; }
        }

        /// <summary>
        ///     总表号
        /// </summary>
        public string S_ZONGBIAOH
        {
            get { return m_str_s_zongbiaoh; }
            set { m_str_s_zongbiaoh = value; }
        }

        /// <summary>
        ///     备注
        /// </summary>
        public string S_BEIZHU
        {
            get { return m_str_s_beizhu; }
            set { m_str_s_beizhu = value; }
        }

        /// <summary>
        ///     序号
        /// </summary>
        public decimal? I_XUHAO
        {
            get { return m_dec_i_xuhao; }
            set { m_dec_i_xuhao = value; }
        }

        /// <summary>
        ///     类型
        /// </summary>
        public decimal? I_WTYPE
        {
            get { return m_dec_i_wtype; }
            set { m_dec_i_wtype = value; }
        }

        /// <summary>
        ///     记录状态0是正常数据，-1是删除数据
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     添加人
        /// </summary>
        public string S_TIANJIAR
        {
            get { return m_str_s_tianjiar; }
            set { m_str_s_tianjiar = value; }
        }

        /// <summary>
        ///     添加日期
        /// </summary>
        public DateTime? D_TIANJIARQ
        {
            get { return m_DT_d_tianjiarq; }
            set { m_DT_d_tianjiarq = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作日期
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }

        /// <summary>
        ///     开始年月
        /// </summary>
        public string S_KAISHINY
        {
            get { return m_str_s_kaishiny; }
            set { m_str_s_kaishiny = value; }
        }

        /// <summary>
        ///     结束年月
        /// </summary>
        public string S_JIESHUNY
        {
            get { return m_str_s_jieshuny; }
            set { m_str_s_jieshuny = value; }
        }

        /// <summary>
        ///     原水表编号
        /// </summary>
        public string S_YUANSHUIBH
        {
            get { return m_str_s_yuanshuibh; }
            set { m_str_s_yuanshuibh = value; }
        }

        /// <summary>
        ///     质量
        /// </summary>
        public string S_ZHILIANG
        {
            get { return m_str_s_zhiliang; }
            set { m_str_s_zhiliang = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_YH_SHUIBIAOXXBProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_YH_SHUIBIAOXXBProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB实体添加或者修改QS_YH_SHUIBIAOXXB信息
        /// </summary>
        public bool InsertOrUpdate(QS_YH_SHUIBIAOXXB QS_YH_SHUIBIAOXXB, OracleTransaction Transaction)
        {
            if (QS_YH_SHUIBIAOXXB.ID == 0)
                InsertQS_YH_SHUIBIAOXXB(QS_YH_SHUIBIAOXXB, Transaction);
            else
                UpdateQS_YH_SHUIBIAOXXB(QS_YH_SHUIBIAOXXB, Transaction);
            return QS_YH_SHUIBIAOXXB.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB实体添加或修改QS_YH_SHUIBIAOXXB信息
        /// </summary>
        public bool InsertOrUpdate(QS_YH_SHUIBIAOXXB QS_YH_SHUIBIAOXXB)
        {
            return InsertOrUpdate(QS_YH_SHUIBIAOXXB, null);
        }


        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB主键删除QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YH_SHUIBIAOXXB(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_YH_SHUIBIAOXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB主键删除QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_YH_SHUIBIAOXXB(decimal ID)
        {
            return DeleteQS_YH_SHUIBIAOXXB(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YH_SHUIBIAOXXBsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_YH_SHUIBIAOXXBsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_YH_SHUIBIAOXXBsDynamic(string WhereClause)
        {
            return DeleteQS_YH_SHUIBIAOXXBsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB主键选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public QS_YH_SHUIBIAOXXB SelectQS_YH_SHUIBIAOXXB(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_SHUIBIAOXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_YH_SHUIBIAOXXB = PopulateQS_YH_SHUIBIAOXXB(rd);
                rd.Close();
                return QS_YH_SHUIBIAOXXB;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_YH_SHUIBIAOXXB主键选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public QS_YH_SHUIBIAOXXB SelectQS_YH_SHUIBIAOXXB(decimal ID)
        {
            return SelectQS_YH_SHUIBIAOXXB(ID, null);
        }

        /// <summary>
        ///     选择所有QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_SHUIBIAOXXBsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <returns>所有QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsAll()
        {
            return SelectQS_YH_SHUIBIAOXXBsAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_SHUIBIAOXXBsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_YH_SHUIBIAOXXBsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_YH_SHUIBIAOXXBsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_YH_SHUIBIAOXXB信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_YH_SHUIBIAOXXB信息</returns>
        public DataTable SelectQS_YH_SHUIBIAOXXBsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_YH_SHUIBIAOXXBsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_YH_SHUIBIAOXXB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YH_SHUIBIAOXXBsDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_YH_SHUIBIAOXXBDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_YH_SHUIBIAOXXB字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_YH_SHUIBIAOXXBsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_YH_SHUIBIAOXXBsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_YH_SHUIBIAOXXB(QS_YH_SHUIBIAOXXB QS_YH_SHUIBIAOXXB, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_YH_SHUIBIAOXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YH_SHUIBIAOXXB.S_QUSHUIK;
            storedParams[1].Value = QS_YH_SHUIBIAOXXB.S_SHUIBIAOBH;
            storedParams[2].Value = QS_YH_SHUIBIAOXXB.S_CEHAO;
            storedParams[3].Value = QS_YH_SHUIBIAOXXB.S_BIAOHAO;
            storedParams[4].Value = QS_YH_SHUIBIAOXXB.S_BIAOFENL;
            storedParams[5].Value = QS_YH_SHUIBIAOXXB.S_BIAOBIAOJ;
            storedParams[6].Value = QS_YH_SHUIBIAOXXB.S_SHUILIANGLB;
            storedParams[7].Value = QS_YH_SHUIBIAOXXB.S_ZONGBIAOH;
            storedParams[8].Value = QS_YH_SHUIBIAOXXB.S_BEIZHU;
            storedParams[9].Value = QS_YH_SHUIBIAOXXB.I_XUHAO;
            storedParams[10].Value = QS_YH_SHUIBIAOXXB.I_WTYPE;
            storedParams[11].Value = QS_YH_SHUIBIAOXXB.I_JLZT;
            storedParams[12].Value = QS_YH_SHUIBIAOXXB.S_TIANJIAR;
            storedParams[13].Value = QS_YH_SHUIBIAOXXB.D_TIANJIARQ;
            storedParams[14].Value = QS_YH_SHUIBIAOXXB.S_CAOZUOR;
            storedParams[15].Value = QS_YH_SHUIBIAOXXB.D_CAOZUORQ;
            storedParams[16].Value = QS_YH_SHUIBIAOXXB.S_KAISHINY;
            storedParams[17].Value = QS_YH_SHUIBIAOXXB.S_JIESHUNY;
            storedParams[18].Value = QS_YH_SHUIBIAOXXB.S_YUANSHUIBH;
            storedParams[19].Value = QS_YH_SHUIBIAOXXB.S_ZHILIANG;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_YH_SHUIBIAOXXB.ID = Convert.ToInt32(storedParams[20].Value);
            return result;
        }

        private bool UpdateQS_YH_SHUIBIAOXXB(QS_YH_SHUIBIAOXXB QS_YH_SHUIBIAOXXB, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_YH_SHUIBIAOXXB";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_YH_SHUIBIAOXXB.S_QUSHUIK;
            storedParams[1].Value = QS_YH_SHUIBIAOXXB.S_SHUIBIAOBH;
            storedParams[2].Value = QS_YH_SHUIBIAOXXB.S_CEHAO;
            storedParams[3].Value = QS_YH_SHUIBIAOXXB.S_BIAOHAO;
            storedParams[4].Value = QS_YH_SHUIBIAOXXB.S_BIAOFENL;
            storedParams[5].Value = QS_YH_SHUIBIAOXXB.S_BIAOBIAOJ;
            storedParams[6].Value = QS_YH_SHUIBIAOXXB.S_SHUILIANGLB;
            storedParams[7].Value = QS_YH_SHUIBIAOXXB.S_ZONGBIAOH;
            storedParams[8].Value = QS_YH_SHUIBIAOXXB.S_BEIZHU;
            storedParams[9].Value = QS_YH_SHUIBIAOXXB.I_XUHAO;
            storedParams[10].Value = QS_YH_SHUIBIAOXXB.I_WTYPE;
            storedParams[11].Value = QS_YH_SHUIBIAOXXB.I_JLZT;
            storedParams[12].Value = QS_YH_SHUIBIAOXXB.S_TIANJIAR;
            storedParams[13].Value = QS_YH_SHUIBIAOXXB.D_TIANJIARQ;
            storedParams[14].Value = QS_YH_SHUIBIAOXXB.S_CAOZUOR;
            storedParams[15].Value = QS_YH_SHUIBIAOXXB.D_CAOZUORQ;
            storedParams[16].Value = QS_YH_SHUIBIAOXXB.S_KAISHINY;
            storedParams[17].Value = QS_YH_SHUIBIAOXXB.S_JIESHUNY;
            storedParams[18].Value = QS_YH_SHUIBIAOXXB.S_YUANSHUIBH;
            storedParams[19].Value = QS_YH_SHUIBIAOXXB.S_ZHILIANG;
            storedParams[20].Value = QS_YH_SHUIBIAOXXB.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_YH_SHUIBIAOXXB PopulateQS_YH_SHUIBIAOXXB(IDataReader dr)
        {
            var QS_YH_SHUIBIAOXXB = new QS_YH_SHUIBIAOXXB();
            QS_YH_SHUIBIAOXXB.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_YH_SHUIBIAOXXB.S_QUSHUIK = dr["S_QUSHUIK"] == DBNull.Value ? null : (string) dr["S_QUSHUIK"];
            QS_YH_SHUIBIAOXXB.S_SHUIBIAOBH = dr["S_SHUIBIAOBH"] == DBNull.Value ? null : (string) dr["S_SHUIBIAOBH"];
            QS_YH_SHUIBIAOXXB.S_CEHAO = dr["S_CEHAO"] == DBNull.Value ? null : (string) dr["S_CEHAO"];
            QS_YH_SHUIBIAOXXB.S_BIAOHAO = dr["S_BIAOHAO"] == DBNull.Value ? null : (string) dr["S_BIAOHAO"];
            QS_YH_SHUIBIAOXXB.S_BIAOFENL = dr["S_BIAOFENL"] == DBNull.Value ? null : (string) dr["S_BIAOFENL"];
            QS_YH_SHUIBIAOXXB.S_BIAOBIAOJ = dr["S_BIAOBIAOJ"] == DBNull.Value ? null : (string) dr["S_BIAOBIAOJ"];
            QS_YH_SHUIBIAOXXB.S_SHUILIANGLB = dr["S_SHUILIANGLB"] == DBNull.Value ? null : (string) dr["S_SHUILIANGLB"];
            QS_YH_SHUIBIAOXXB.S_ZONGBIAOH = dr["S_ZONGBIAOH"] == DBNull.Value ? null : (string) dr["S_ZONGBIAOH"];
            QS_YH_SHUIBIAOXXB.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string) dr["S_BEIZHU"];
            QS_YH_SHUIBIAOXXB.I_XUHAO = dr["I_XUHAO"] == DBNull.Value ? null : (decimal?) dr["I_XUHAO"];
            QS_YH_SHUIBIAOXXB.I_WTYPE = dr["I_WTYPE"] == DBNull.Value ? null : (decimal?) dr["I_WTYPE"];
            QS_YH_SHUIBIAOXXB.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_YH_SHUIBIAOXXB.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string) dr["S_TIANJIAR"];
            QS_YH_SHUIBIAOXXB.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?) dr["D_TIANJIARQ"];
            QS_YH_SHUIBIAOXXB.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_YH_SHUIBIAOXXB.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            QS_YH_SHUIBIAOXXB.S_KAISHINY = dr["S_KAISHINY"] == DBNull.Value ? null : (string) dr["S_KAISHINY"];
            QS_YH_SHUIBIAOXXB.S_JIESHUNY = dr["S_JIESHUNY"] == DBNull.Value ? null : (string) dr["S_JIESHUNY"];
            QS_YH_SHUIBIAOXXB.S_YUANSHUIBH = dr["S_YUANSHUIBH"] == DBNull.Value ? null : (string) dr["S_YUANSHUIBH"];
            QS_YH_SHUIBIAOXXB.S_ZHILIANG = dr["S_ZHILIANG"] == DBNull.Value ? null : (string) dr["S_ZHILIANG"];
            return QS_YH_SHUIBIAOXXB;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion